home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / tcl / Tcl_Return.man < prev    next >
Text File  |  1990-04-26  |  3KB  |  135 lines

  1.  
  2.  
  3.  
  4. Tcl_Return        Tcl Command Language Library         Tcl_Return
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      Tcl_Return - set up a Tcl result string
  12.  
  13. SSYYNNOOPPSSIISS
  14.      ##iinncclluuddee <<ttccll..hh>>
  15.  
  16.      TTccll__RReettuurrnn(_i_n_t_e_r_p, _s_t_r_i_n_g, _s_t_a_t_u_s)
  17.  
  18. AARRGGUUMMEENNTTSS
  19.      Tcl_Interp               *_i_n_t_e_r_p(out)
  20.                                         Interpreter for  which  a
  21.                                         return  value  is  to  be
  22.                                         established.
  23.  
  24.      char      *_s_t_r_i_n_g        (in)      String   value   to    be
  25.                                         returned, or NNUULLLL.
  26.  
  27.      int       _s_t_a_t_u_s         (in)      Indicates the  nature  of
  28.                                         _s_t_r_i_n_g.   Must  be either
  29.                                         TTCCLL__SSTTAATTIICC,  TTCCLL__DDYYNNAAMMIICC,
  30.                                         or TTCCLL__VVOOLLAATTIILLEE.
  31.  
  32. _________________________________________________________________
  33.  
  34.  
  35. DDEESSCCRRIIPPTTIIOONN
  36.      TTccll__RReettuurrnn is a convenience routine used by several  of  the
  37.      Tcl  commands.   It  arranges  for  _s_t_r_i_n_g  to be the return
  38.      string for the current Tcl command in _i_n_t_e_r_p.  If _s_t_a_t_u_s  is
  39.      TTCCLL__SSTTAATTIICC  it means that _s_t_r_i_n_g refers to an area of static
  40.      storage that is guaranteed  to  remain  untouched  until  at
  41.      least  the  next call to TTccll__EEvvaall.  If _s_t_a_t_u_s is TTCCLL__DDYYNNAAMMIICC
  42.      it means that _s_t_r_i_n_g was allocated with a call  to  mmaalllloocc(())
  43.      and  is now the property of the Tcl system.  TTccll__RReettuurrnn will
  44.      arrange for the string's storage to be released  by  calling
  45.      ffrreeee(())  when  it is no longer needed.  The third possibility
  46.      is for _s_t_a_t_u_s to be TTCCLL__VVOOLLAATTIILLEE.  This  means  that  _s_t_r_i_n_g
  47.      points to an area of memory that is likely to be overwritten
  48.      when TTccll__RReettuurrnn returns.  In this case  TTccll__RReettuurrnn  makes  a
  49.      copy  of  the  string  and  arranges  for the copy to be the
  50.      return string for the current Tcl command.
  51.  
  52.      If _s_t_r_i_n_g is NNUULLLL, then _s_t_a_t_u_s  is  ignored  and  TTccll__RReettuurrnn
  53.      re-initializes _i_n_t_e_r_p's result to point to the pre-allocated
  54.      result area, with an empty string in the result area.
  55.  
  56.      In any of the above cases, if _i_n_t_e_r_p  holds  a  dynamically-
  57.      allocated result at the time of the TTccll__RReettuurrnn call, the old
  58.      result's storage is released by calling ffrreeee(()).
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. Sprite v.1.0        Printed:  April 26, 1990                    1
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. Tcl_Return        Tcl Command Language Library         Tcl_Return
  73.  
  74.  
  75.  
  76. KKEEYYWWOORRDDSS
  77.      command, result, return value, interpreter
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. Sprite v.1.0        Printed:  April 26, 1990                    2
  132.  
  133.  
  134.  
  135.